<?php

namespace app\parent\controller\v1;

use app\common\controller\ParentController;
use app\parent\service\CommentService;

class Comment extends ParentController
{
    /**
     * 班级点评列表
     * User: wufeng
     * Date: 2020/03/09.
     */
    public function classCommentLists()
    {
        if ($this->request->isPost()) {
            $params = $this->request->param();
            $list = (new CommentService($this->type))->classCommentLists($params);
            if (1 !== $list['code']) {
                $this->fail($list);
            }
            $this->win($list);
        }
        $this->fail('ILLEGAL_REQUEST');
    }

    /**
     * 班级课节点评列表
     * User: wufeng
     * Date: 2020/03/11.
     */
    public function classDayCommentLists()
    {
        if ($this->request->isPost()) {
            $params = $this->request->param();
            $list = (new CommentService($this->type))->classDayCommentLists($params);
            if (1 !== $list['code']) {
                $this->fail($list);
            }
            $this->win($list);
        }
        $this->fail('ILLEGAL_REQUEST');
    }

    /**
     * 课节点评详情
     * User: wufeng
     * Date: 2020/03/05.
     */
    public function classDayCommentDetail()
    {
        if ($this->request->isPost()) {
            $params = $this->request->param();
            $list = (new CommentService($this->type))->classDayCommentDetail($params);
            if (1 !== $list['code']) {
                $this->fail($list);
            }
            $this->win($list);
        }
        $this->fail('ILLEGAL_REQUEST');
    }

    /**
     * 课节点评
     * User: wufeng
     * Date: 2020/03/05.
     */
    public function classDayComment()
    {
        if ($this->request->isPost()) {
            $params = $this->request->param();
            $list = (new CommentService($this->type))->classDayComment($params);
            if (1 !== $list['code']) {
                $this->fail($list);
            }
            $this->win($list);
        }
        $this->fail('ILLEGAL_REQUEST');
    }
}
